package cn.ccl;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("order")
public class OrderController {

    @Reference
    private UserApi userApi;

    @GetMapping
    public String hello(){
        // 执行RPC远程调用, 获取dubbo服务返回结果. 在浏览器显示
        String result = userApi.sayHi("Tom");
        System.out.println("请求成功了！");
        return result;
    }



}
